﻿@using SPMS.Data
@model SPMS.Data.Packaging
@{
    //获得第一副图片
    PackagingImage firstImage = Model.PackagingImages.FirstOrDefault();
}
<div class="spms-item-info">
    <div class="spms-item-image">
        @{
            //判断是否有图片
            if (null != firstImage)
            {
            @Html.Raw(string.Format("<span id=\"span_{0}\">{1}</span>", Model.Packaging_ID, Html.Encode(firstImage.Image_Title)));
            }
        }
        <div class="spms-item-preview">
            @{
                //判断是否有图片
                if (null != firstImage)
                {
                @Html.Raw(string.Format("<img id=\"img_{0}\" title=\"{1}\" alt=\"{1}\" src=\"{2}?File_ID={3}\"/>", Model.Packaging_ID, Html.Encode(string.IsNullOrEmpty(firstImage.Image_Desc) ? firstImage.Image_Title : firstImage.Image_Desc ?? firstImage.Image_Title), this.Url.Action("GetImage"), firstImage.Image_ID));
                }
            }
        </div>
        <div class="spms-item-thumbnails-list">
            <a class="spms-item-thumbnails-forward" onclick="spms.event.OnThumbnailsForward('@string.Format("thumb_{0}", Model.Packaging_ID)');"></a>
            <div id="@string.Format("thumb_{0}", Model.Packaging_ID)" class="spms-item-thumbnails-items">
                <ul class="spms-item-thumbnails">
                    @{
                        //循环添加缩略图
                        foreach (PackagingImage image in Model.PackagingImages)
                        {
                            //输出HTML内容             
                        @Html.Raw(string.Format("<li title=\"{0}\" data-url=\"{3}?File_ID={1}\" data-title=\"{4}\" data-desc=\"{5}\" data-target=\"{6}\" onmouseover=\"spms.event.OnPreviewImage(this);\"><img alt=\"{0}\" src=\"{2}?File_ID={1}\"/></li>", Html.Encode(image.Image_Title), image.Image_ID, this.Url.Action("GetThumbnails"), this.Url.Action("GetImage"), Html.Encode(image.Image_Title), Html.Encode(image.Image_Desc), Model.Packaging_ID));
                        }
                    }
                </ul>
            </div>
            <a class="spms-item-thumbnails-backward" onclick="spms.event.OnThumbnailsBackward('@string.Format("thumb_{0}", Model.Packaging_ID)');"></a>
        </div>
    </div>
    <div class="spms-item-intro">
        <div class="spms-item-intro-summary">
            <h1>@Model.Packaging_Name</h1>
        </div>
        <div class="spms-item-intro-detail">
            <ul>
                <li>
                    <div class="spms-item-intro-detail-item-title">引用缩写：</div>
                    <div class="spms-item-intro-detail-item-content">@Html.Raw(Model.Packaging_Abbr)</div>
                </li>
                <li>
                    <div class="spms-item-intro-detail-item-title">封装名称：</div>
                    <div class="spms-item-intro-detail-item-content">@Html.Raw(Model.Packaging_Name)</div>
                </li>
                <li>
                    <div class="spms-item-intro-detail-item-title">附加说明：</div>
                    <div class="spms-item-intro-detail-item-content">@Html.Raw(Model.Memo)</div>
                </li>
            </ul>
        </div>
    </div>
</div>
